interface UserData {
  username: string;
}

import { defineStore } from 'pinia';

export const useAuthStore = defineStore('auth', {
  state: () => ({ 
    isLoggedIn: false, 
    user: null as UserData | null
  }),
  actions: {
    login(userData: UserData) {
      this.isLoggedIn = true;
      this.user = userData;
    },
    logout() {
      this.isLoggedIn = false;
      this.user = null;
    }
  }
});